package com.hooda.config;

import cn.com.duiba.credits.sdk.CreditTool;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author zhangzp
 * @version 1.0, 2021/10/14
 */
@Component
@EnableConfigurationProperties(DuibaConfiguration.class)
@ConfigurationProperties("duiba")
public class DuibaConfiguration {

    private String appKey;

    private String appSecret;

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    @Bean
    public CreditTool creditTool() {
        return new CreditTool(appKey, appSecret);
    }
}
